<template>
  <div class="wrapper">
    <swiper :options="swiperOption">
      <swiper-slide>
        <img class="swiper-img" src="@/assets/images/chrome-bg.png" />
        <div class="tip">
          <h1>{{swiperData.cname}}</h1>
          <p>{{swiperData.chromes}}</p>
        </div>
      </swiper-slide>
      <swiper-slide>
        <img class="swiper-img" src="@/assets/images/firefox-bg.png" />
        <div class="tip">
          <h1>{{swiperData.fname}}</h1>
          <p>{{swiperData.firefoxs}}</p>
        </div>
      </swiper-slide>
      <swiper-slide>
        <img class="swiper-img" src="@/assets/images/ie-bg.png" />
        <div class="tip">
          <h1>{{swiperData.iname}}</h1>
          <p>{{swiperData.ies}}</p>
        </div>
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: {
    swiperData: Object
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        autoplay: 2000,
        speed: 1000,
        autoplayDisableOnInteraction: false,
        loop: true
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet
    background: red
  .swiper-img
    width: 35%
    display: block
    margin: 0 auto
    padding: 3rem 0 0 0
  .tip
    width: 50%
    height: 15%
    position: absolute
    top: 40%
    left: 25%
    font-size: 150%
    text-align: center
    text-shadow: 3px 3px 5px #003300;
    color: #fff
</style>
